#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wiley 诊断测试运行脚本
简化版本，用于快速执行诊断
"""

import sys
import os
from pathlib import Path

# 添加项目根目录到路径
current_dir = Path(__file__).parent
project_root = current_dir.parent
sys.path.insert(0, str(project_root))
sys.path.insert(0, str(project_root / 'crawl'))

def main():
    """主函数"""
    print("=" * 60)
    print("Wiley 网站通讯作者信息提取诊断工具")
    print("=" * 60)
    print(f"测试URL: https://advanced.onlinelibrary.wiley.com/doi/abs/10.1002/adfm.202517996")
    print(f"项目根目录: {project_root}")
    print(f"当前工作目录: {os.getcwd()}")
    print("=" * 60)
    
    try:
        # 导入并运行诊断测试
        from test_wiley_diagnosis import WileyDiagnosticTester
        
        tester = WileyDiagnosticTester()
        tester.run_full_diagnosis()
        
    except ImportError as e:
        print(f"❌ 导入错误: {e}")
        print("请确保您在正确的目录中运行此脚本")
        print(f"当前目录: {os.getcwd()}")
        print(f"期望目录: {project_root}")
        
    except Exception as e:
        print(f"❌ 运行错误: {e}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    main()